package com.net.hash.equal;

import java.util.HashMap;
import java.util.Map;

public class TestHash {

	public static void main(String[] args) 
	{
		Student first = new Student("A",1);
		Student second = new Student("A",1);
		
        HashMap<Student,Integer> map = new HashMap<Student,Integer>();
        
        map.put(first, 10);
        map.put(second, 20);
        
        for(Map.Entry<Student, Integer> key : map.entrySet())
        {
        	System.out.println(" key " +key.getKey().getId()+ "  " + key.getKey().getName() + "  value  " + key.getValue());
        }
	}

}
